import React from 'react'
import { useState } from 'react';
import B from '../B/B'
//1. 创建 context 对象  React.Component
export let countContext = React.createContext();
export default function A() {
  let [count, setCount] = useState(100);
  return (
    <div>
      {/* 2. 使用 countContext.Provider 对子集组件包裹 */}
      <countContext.Provider value={[count, setCount]}>
        <h1>AAA</h1>
        <B  />
      </countContext.Provider>
    </div>
  )
}
